//
//  ViewController.m
//  文字拼音对齐计算
//
//  Created by GZCP1897 on 2017/12/25.
//  Copyright © 2017年 GZCP1897. All rights reserved.
//

#import "ViewController.h"
#import <Masonry.h>
#import "HKEPPhonticCaculateManager.h"

#define labelWidth    250.0//Lable的最大宽度


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UILabel *lable = [[UILabel alloc] init];
    lable.layer.borderColor = [UIColor redColor].CGColor;
    lable.layer.borderWidth = 1.;
    lable.numberOfLines = 0;
    lable.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:lable];
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.width.mas_equalTo(labelWidth);
    }];
    //我爱你如果这是测试的话 i1 love2 you4 if5 this6 is7 a8 testing10 shi9 de3 hua0
    //梁浩洋 liang2 hao4 yang2
    
    HKEPPhonticCaculateManager *manager = [[HKEPPhonticCaculateManager alloc] init];
    lable.attributedText = [manager caculateAttributedStringWithTextString:@"我爱你/如果这是测试的话" phonticString:@"i1 love2 you4 /if5 this6 is7 a822222 test11ing10 shi9 de3 hua0" widthMax:labelWidth];
//    NSString *str = @"唔𠸎耕";
//    NSMutableAttributedString *result = [[NSMutableAttributedString alloc] init];
//
//
//    lable.attributedText = result;
}
@end
